import time

sp=[]
with open('m1_sorted.txt') as f:
    for x in f:
        sp.append(int(x))
N=len(sp)
start=time.time()
for i in range(N-1):
    for j in range(N-i-1):
        if sp[j]>sp[j+1]:
            sp[j], sp[j+1]=sp[j+1],sp[j]
end=time.time()


sp=[]
with open('m2_reverse.txt') as f:
    for x in f:
        sp.append(int(x))
N=len(sp)
start2=time.time()
for i in range(N-1):
    for j in range(N-i-1):
        if sp[j]>sp[j+1]:
            sp[j], sp[j+1]=sp[j+1],sp[j]
end2=time.time()


sp=[]
with open('m3_shuffle.txt') as f:
    for x in f:
        sp.append(int(x))
N=len(sp)
start3=time.time()
for i in range(N-1):
    for j in range(N-i-1):
        if sp[j]>sp[j+1]:
            sp[j], sp[j+1]=sp[j+1],sp[j]
end3=time.time()
print('m1_sorted',round((end-start)*10**3),"milliseconds")
print('m2_reverse',round((end2-start2)*10**3),"milliseconds")
print('m3_shuffle',round((end3-start3)*10**3),"milliseconds")